<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>平台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet"href="/css/plat-style.css">
</head>
<style>
    input,select{
        background-color: rgba(192,192,192, .2) !important;
        cursor: no-drop;
    }
</style>
<body>

<div style="margin-top: 30px;">
    <a href="/bankloan/list" class="layui-btn" style="margin-left: 10px" >取消</a>
    <a href="/bankloan/edit?id=${bankLoan.id}" type="button" class="layui-btn layui-btn-normal"  id="saveBtn">编辑</a>
</div>

<div class="layui-tab" style="background-color: white">
    <ul class="layui-tab-title">
        <li class="layui-this">基本信息</li>
        <li>属性</li>
        <li>详情</li>
    </ul>
    <div class="layui-tab-content">
        <%-- 基本信息--%>
        <div class="layui-tab-item layui-show">
            <div class="layui-form-item" style="width:50%">
                <label class="layui-form-label">贷款名称:</label>
                <div class="layui-input-block">
                    <input disabled  type="text" name="loanName" id="loanName"  value="${bankLoan.loanName}" lay-verify="title" autocomplete="off" placeholder="请输入贷款名称" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" style="width: 50%">
                <label class="layui-form-label">是否启用:</label>
                <div class="layui-input-block">
                    <select class="layui-input" id="status">
                        <option value="1">启用</option>
                        <option value="2">禁用</option>
                    </select>
                </div>
            </div>
        </div>
        <%-- 属性--%>
        <div class="layui-tab-item" style="margin-top: 20px">
            <form class="layui-form" action="">
                <div style="width: 56%">
                    <c:forEach items="${bankLoanSub}" var="list">
                        <c:choose>
                            <%--1、单选，2、复选，3、下拉框，4、输入框，5、时间框，6、手机，7、省市县区，8、身份证，9邮箱--%>
                            <c:when test="${list.inputType==1}">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">${list.fieldName}:</label>
                                    <div class="layui-input-block">
                                        <c:forEach items="${list.inputValue}" var="l">
                                            <input disabled type="radio" name="sex" value="${l}" title="${l}">
                                        </c:forEach>

                                    </div>
                                </div>
                            </c:when>
                            <c:when test="${list.inputType==2}">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">${list.fieldName}:</label>
                                    <div class="layui-input-block">
                                        <c:forEach items="${list.inputValue}" var="l">
                                            <input disabled type="checkbox"  title="${l}">
                                        </c:forEach>

                                    </div>
                                </div>
                            </c:when>
                            <c:when test="${list.inputType==3}">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">${list.fieldName}:</label>
                                    <div class="layui-input-block">
                                        <select name="city" lay-verify="required">
                                            <c:forEach items="${list.inputValue}" var="l">
                                                <option disabled value="${l}">${l}</option>--%>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                            </c:when>
                            <c:when test="${list.inputType==5}">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">${list.fieldName}:</label>
                                    <div class="layui-input-block">
                                        <input disabled type="text" class="layui-input" placeholder="请选择${list.fieldName}" id="dateInput">
                                    </div>
                                </div>
                            </c:when>
                            <c:when test="${list.inputType==7}">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">${list.fieldName}:</label>
                                    <div class="layui-input-inline">
                                        <select disabled name="quiz1">
                                            <option value="">请选择省</option>
                                            <option value="浙江" selected="">浙江省</option>
                                            <option value="你的工号">江西省</option>
                                            <option value="你最喜欢的老师">福建省</option>
                                        </select>
                                    </div>
                                    <div class="layui-input-inline">
                                        <select disabled name="quiz2">
                                            <option value="">请选择市</option>
                                            <option value="杭州">杭州</option>
                                            <option value="宁波" disabled="">宁波</option>
                                            <option value="温州">温州</option>
                                            <option value="温州">台州</option>
                                            <option value="温州">绍兴</option>
                                        </select>
                                    </div>
                                    <div class="layui-input-inline">
                                        <select disabled name="quiz3">
                                            <option value="">请选择县/区</option>
                                            <option value="西湖区">西湖区</option>
                                            <option value="余杭区">余杭区</option>
                                            <option value="拱墅区">临安市</option>
                                        </select>
                                    </div>
                                </div>
                            </c:when>
                            <c:otherwise>
                                <div class="layui-form-item">
                                    <label class="layui-form-label" >${list.fieldName}:</label>
                                    <div class="layui-input-block">
                                        <input disabled type="text" name="title" required  lay-verify="required" placeholder="请输入${list.fieldName}"   value='<c:if test="${list.inputValue !=null}">${list.inputValue }</c:if>' autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </c:otherwise>
                        </c:choose>
                    </c:forEach>
                </div>
            </form>
        </div>
        <%--详情--%>
        <div  class="layui-tab-item">
            <div class="layui-col-sm12" >
                                    <textarea id="content" name="content"
                                              style="display: none">${bankLoan.loanDetails}</textarea>
                <script  id="articleEditor" type="text/plain"
                        style="width:100%;height:400px"></script>
            </div>
        </div>
    </div>
</div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script type="text/javascript" src="/js/plugins/image/previewImg.js"></script>
<script type="text/javascript" src="/js/plugins/dropzone/dropzone.js"></script>
<script type="text/javascript" src="/js/plugins/layui-formSelect/formSelects-v4.min.js"></script>
<script type="text/javascript" src="/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','laydate'], function(){
        var $ = layui.$,
            form = layui.form,
            element = layui.element,
            layer = layui.layer;
        form.render('select');
        element.render();

        //日期框
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#dateInput' //指定元素
        });
    });


    $(function () {
        /* 富文本编辑器加载 */
        var ue = UE.getEditor('articleEditor');
        ue.ready(function() {
            ue.setContent($("#content").text());
            ue.setDisabled();
        });


        // UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
        // UE.Editor.prototype.getActionUrl = function (action) {
        //     if (action == '/uploadFile') {
        //         return '/base/uploadRichFile';
        //     } else {
        //         return this._bkGetActionUrl.call(this, action);
        //     }
        // };
        // UE.getEditor('articleEditor').ready(function () {
        //     UE.getEditor('articleEditor').setContent($("#content").text());
        // });
        // // layui多选插件加载
        // var formSelects = layui.formSelects;
        // formSelects.value('label');
    });

</script>
</body>
</html>
